package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where openid=#{openid}")
    User wxlogin(String openid);


    void insert(User user);

    @Select("select * from user where id=#{userId}")
    User getById(Long userId);

    Integer countByDate(LocalDateTime end);

    Integer newcountByDate(LocalDateTime begin, LocalDateTime end);

    @Select("select count(id) from user where create_time between #{begin} and #{end}")
    Integer countNewUserByDate(LocalDateTime begin, LocalDateTime end);
}
